<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-选择畅销商品">
</@frame.head>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/search_table.css" />
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 促销管理 <span class="c-gray en">&gt;</span> 选择畅销商品 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
<form method="post" name="query_product_list_form"  id="query_product_list_form" action="${contextPath}/sell_well_product/product_list" >    
   <input type="hidden" name="page" value="${pagination.pageNo}"  id="page" />                        
    <div class="text-c">
        <table class="table search_table">
           <tr>   
           <td>商品编号：</td>
           <td><input type="text" class="input-text  radius" placeholder="商品编号" id="" name="prodId" value="${(productQo.prodId?c)!}" ></td>
           <td>商品名称：</td>
           <td><input type="text" class="input-text  radius" placeholder="商品名称" id="" name="proName" value="${productQo.proName}"></td>     
           <td>排序方式：</td>
           <td>
           <span class="select-box radius">
           <select class="select"  name="paixu" >
            <option value="1" <#if "1"==productQo.paixu>selected="selected"</#if>>按销售量降序排列</option>
            <option value="2" <#if "2"==productQo.paixu>selected="selected"</#if>>按点击量降序排列</option>
            <option value="3" <#if "3"==productQo.paixu>selected="selected"</#if>>按收藏量量降序排列</option>
           </select>
           </span>
           </td>  
          </tr>
         <tr><td colspan="6" style="text-align:center;" >
           <input class="btn btn-success radius" type="submit"   value="搜索" />
             </td>
         </tr>
      </table>
    </div>
</form>

    <div class="cl pd-5 bg-1 bk-gray"> 
    <table class="table table-border table-bordered table-bg"  id="specs_table">
        <thead>
        <tr  class="text-c">
            <th >商品编号</th>
            <th width="250px">商品名称</th>
            <th >销售数量</th>
            <th >点击量</th>
			<th >收藏量</th>
            <th >操作</th>
        </tr>
        </thead>
        <tbody>
       <#if pagination.list?? && (pagination.list?size &gt; 0) >
        <#list pagination.list as product> 
             <tr  class="text-c">
                <td>${product.id?c}</td>
                <td>${product.baseInfo.name}</td>
                <td>${product.statisticsInfo.saleNum}</td>
                <td>${product.statisticsInfo.clickNum}</td>
                <td>${product.statisticsInfo.favouriteNum}</td>
                <td><a href="javascript:;" onclick="setSellWell('${product.id?c}');">设置为畅销商品</a></td>
        </tr>
      </#list></#if>
     </tbody>
    </table>
    <div id="div_page" style="padding-top: 10px;float: right"></div>
</div>
<@frame.end "default">
</@frame.end>
</html>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/sell_well_product/product_list.js"></script>
<script type="text/javascript">
var path="${contextPath}";
laypage({
    cont: 'div_page',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
	skip: true, //是否开启跳页
	first: 1, //将首页显示为数字1,。若不显示，设置false即可
	last: ${pagination.totalPage}, //将尾页显示为总页数。若不显示，设置false即可
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
            $("#page").val(obj.curr);
            $("#query_product_list_form").submit();
        }
    }
})  
</script>